<template>
  vue3使用示例
  ref:{{num}}
  reactive :{{state.count}}
  方法：<span @click="increment"> +</span>
  computed: {{authorCom}}
</template>
<script setup>
  import { ref,reactive,computed } from 'vue';
  import {
    onLoad,
    onShow
  } from "@dcloudio/uni-app";
  
  const num = ref(0);
  const state = reactive({ count: 0 })
  const author = reactive({
     name: 'John Doe'
  })
  const authorCom = computed(() => {
  return author.name.length > 0 ? 'Yes' : 'No'
})
  // 方法 
  function increment() {
  state.count++
}
  // onLoad 接受 A 页面传递的参数
  onLoad((option) => {
    console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'}
  });

  onShow(() => {
    console.log("B 页面 onShow");
  });
</script>